package com.hennissy.utils;

import java.util.Objects;
import java.util.UUID;

/**
 * 省市区号规则生成门店id
 */
public class GetStoreId {

    /**
     * 获取随机id
     * @return
     * @param province
     * @param city
     * @param area
     */
    public static String get(String province, String city, String area) {

        if (!Objects.isNull(province)&&!Objects.isNull(province)&&!Objects.isNull(province)){
            StringBuffer stringBuffer=new StringBuffer();
            stringBuffer.append(province).append(city).append(area);
            String md5Hash = Md5Encode.md5Encode(stringBuffer.toString().getBytes());
            StringBuffer stringBuffer2=new StringBuffer(UUID.randomUUID().toString().replaceAll("-",""));
            stringBuffer2.append("-").append(md5Hash);
            return stringBuffer2.toString();
        }else {
            throw new RuntimeException("省、市、区不能为空");
        }

    }

    public static void main(String[] args) {
        System.out.println(get("132", "1312", "3213"));
    }
}
